package com.changgou.order.dao;

import com.changgou.order.pojo.Task;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.Date;
import java.util.List;

/**
 * @Author LQQ
 * @Date 2020/3/13 22:24
 * @Version 1.0
 */
public interface TaskMapper extends Mapper<Task> {

@Select("select * from tb_task where update_time<#{currentTime}")
//实体类与数据库字段名不对应,得这样写下映射
@Results({@Result(column = "create_time",property = "createTime"),
        @Result(column = "update_time",property = "updateTime"),
        @Result(column = "delete_time",property = "deleteTime"),
        @Result(column = "task_type",property = "taskType"),
        @Result(column = "mq_exchange",property = "mqExchange"),
        @Result(column = "mq_routingkey",property = "mqRoutingkey"),
        @Result(column = "request_body",property = "requestBody"),
        @Result(column = "status",property = "status"),
        @Result(column = "errormsg",property = "errormsg")})

    List<Task> findTaskLessThanCurrentTime(Date currentTime);

}
